<link rel="stylesheet" type="text/css" href="../core/resource/css/qiandao.css">
<style>
        .member-page .headinfo,
        .advaward .body .award-body .item .iconn.candraw,
        .btn.btn-warning.btn-know {background: #24b2f4;}
        .calendar .title,
        .select-date,
        .advaward .body .award-body .item .days.candraw,
        .advaward .body .award-body .item .text.candraw,
        .calendar .body .week .day .signed {color:#24b2f4;}
        .calendar .body .week .day.today:before,
        .advaward .body .award-body .item .text.candraw {border-color: #24b2f4;}
</style>
<div class='fui-page fui-page-current'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback()"></a>
        </div>
        <div class="title">积分签到</div>
    </div>
    <div class='fui-content member-page navbar'>
        <div class="headinfo">
            <a class="setbtn record" href="javascript:;" ng-click="access_json('core/member.qd_log/')">详细记录</a>
            <div class="child">
                <div class="title">连续签到</div>
                <div class="num"><span id="signorder">{{pagedata.days}}</span>天</div>
            </div>
            <div class="child userinfo">
                <div class="face">
                    <img ng-src="{{tomedia(pagedata.member.avatar)}}"/>
                </div>
                <div class="name">{{pagedata.member.nickname}}</div>
                <div class="name">我的积分:<span id="credit">{{pagedata.member.credit1}}</span>积分</div>
                <div class="level" style="padding-top: 0.2rem">
                    <div class="btn sign" id="btn-sign" ng-if="pagedata.signed">今日已签</div>
					<div class="btn sign" id="btn-sign" ng-if="!pagedata.signed" ng-click="post({},'sign')">点击签到</div>
                </div>
            </div>
            <div class="child">
                <div class="title">总签到</div>
                <div class="num"><span id="signsum">{{pagedata.alldays}}</span>天</div>
            </div>
        </div>
        <div class="calendar">
            <div class="title">
                <span class="date">
                    <i class="icon icon-calendar1"></i>
                    <select  id="date" ng-model="pagedata.month_choosed" class="select-date" name="date" ng-change="getmonth()">
                        <option ng-repeat="month in pagedata.months" value="{{month.value}}" ng-selected="pagedata.month_choosed==month.value">{{month.title}}</option>
                    </select>
                </span>
                <span class="rule" id="signrule" ng-click="pagedata.show_rule=1">签到规则</span>
            </div>
            <div class="body" id="calendar">
				<div class="week">
					<nav class="day">
						<p class="num">一</p>
					</nav>
					<nav class="day">
						<p class="num">二</p>
					</nav>
					<nav class="day">
						<p class="num">三</p>
					</nav>
					<nav class="day">
						<p class="num">四</p>
					</nav>
					<nav class="day">
						<p class="num">五</p>
					</nav>
					<nav class="day">
						<p class="num">六</p>
					</nav>
					<nav class="day">
						<p class="num">日</p>
					</nav>
				</div>
				<div ng-repeat="week in pagedata.monthdata" class="week">
					<nav ng-repeat="i in pagedata.weeks" class="day" ng-class="{'today':(week[i] && pagedata.today==week[i].value)}">
						<p class="num" ng-if="week[i]">{{week[i].title}}</p>
						<i ng-show="week[i].signed" class="icon icon-selected signed" style="top:1.6rem"></i>
					</nav>
				</div>
            </div>
            <div ng-show="pagedata.setting.singold==1" class="fui-title" style="background: #fff; margin: 0; padding-bottom: 0.5rem">提示：点击漏签日期可补签哦~</div>
			<div class="advaward" ng-if="pagedata.reward_lianxu">
				<div class="title" style=" font-size: 0.7rem; color: #888;">
					<span class="text"><i class="icon icon-goods1"></i> 连续签到有礼</span>
					<span class="subtitle">连续签到即可领取</span>
				</div>
				<div class="body">
					<div class="award">
						<div class="award-body">
							<div class="item" ng-repeat="item_lianxu in pagedata.reward_lianxu">
								<div class="goods" ng-if="item_lianxu.credit1">+{{item_lianxu.credit1}}<br>积分</div>
								<div class="iconn candraw"><i class="icon icon-check"></i> </div>
								<div class="days candraw">{{item_lianxu.days}}天</div>
								<div class="text candraw" ng-click="post({'id':item_lianxu.id,'type':1},'core/member.qiandao/reward/')">领取</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="advaward" ng-if="pagedata.reward_leiji">
				<div class="title" style=" font-size: 0.7rem; color: #888;">
					<span class="text"><i class="icon icon-magic"></i>签到有礼</span>
					<span class="subtitle">当月签到次数满足即可领取</span>
				</div>
				<div class="body">
					<div class="award">
						<div class="award-body">
							<div class="item" ng-repeat="item_leiji in pagedata.reward_leiji">
								<div class="goods" ng-if="item_leiji.credit1">+{{item_leiji.credit1}}<br>积分</div>
								<div class="iconn candraw"><i class="icon icon-check"></i> </div>
								<div class="days candraw">{{item_leiji.days}}天</div>
								<div class="text candraw" ng-click="post({'id':item_leiji.id,'type':2},'core/member.qiandao/reward/')">领取</div>
							</div>
						</div>
					</div>
				</div>
			</div>
        </div>
		<div class="pop-rule-hidden" ng-show="pagedata.show_rule==1">
			<div class="verify-pop pop">
				<div class="close"><i class="icon icon-roundclose"></i></div>
				<div class="qrcode">
					<div class="inner">
						<div class="title">签到规则</div>
						<div class="text">{{pagedata.setting.content}}</div>
					</div>
					<div class="inner-btn" style="padding: 0.5rem">
						<div class="btn btn-warning btn-know" ng-click="pagedata.show_rule=0">我知道了</div>
					</div>
				</div>
			</div>
		</div>
    </div>
</div>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<script>
	//获取数据
	window.scope.getmonth=function(){
		var post={'month':window.scope.pagedata.month_choosed};
		window.scope.post(post,'core/member.qiandao/getmonth/','',function(res){
			window.scope.pagedata.monthdata=res;
		});
	}
</script>